<template>
  <div class="manager">
    <router-view></router-view>
    <!-- 用于接受管理页面，首页，订单页，我的页面 -->
    <van-tabbar v-model="active" active-color="#f78ca0">
      <van-tabbar-item icon="home-o" to="/manager/home">首页</van-tabbar-item>
      <van-tabbar-item icon="orders-o" to="/manager/order">订单</van-tabbar-item>
      <van-tabbar-item icon="service-o" to="/manager/help">帮助</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/manager/mine">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        active: 0,
      };
    },
    methods: {
      getPath() {
        if (window.location.hash = '#/manager/home') {
          this.active = 0
        } else if (window.location.hash = '#/manager/order') {
          this.active = 1
        } else if (window.location.hash = '#/manager/help') {
          this.active = 2
        } else {
          this.active = 3
        }
      }
    },
    created() {
      this.getPath()
    },
  };
</script>

<style scoped>

</style>